package com.shop.dao.impl;

import com.shop.bean.User;
import com.shop.dao.BaseDao;
import com.shop.dao.UserDao;


public class UserDaoImpl extends BaseDao implements UserDao {
    @Override
    public User queryUserByUsername(String username) {
        String sql = "SELECT `id`, `username`, `password`, `email` FROM t_user WHERE `username` = ?";
        return super.queryForOne(User.class, sql, username);
    }

    @Override
    public int insert(User user) {
        String sql="INSERT into t_user(username,password,email) value(?,?,?)";
        return super.update(sql, user.getUsername(),user.getPassword(),user.getEmail());
    }
}
